﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {

            InitializeComponent();
            label3.Text = progressBar2.Value.ToString();
        }

        private void progressBar1_Click(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (progressBar2.Value > 100)
            {
                progressBar2.Value = progressBar2.Value - 100;
                label3.Text = progressBar2.Value.ToString();
            }
            else
            {
                progressBar2.Value = 0;
                label3.Text = progressBar2.Value.ToString();
                MessageBox.Show("Has ganado!!!");
            }


        }
        private void label3_TextChanged(object sender, EventArgs e)
        {
        }

        private void button2_Click_1(object sender, EventArgs e)
        {
            if (progressBar2.Value > 60)
            {
                progressBar2.Value = progressBar2.Value - 60;
                label3.Text = progressBar2.Value.ToString();
            }
            else
            {
                progressBar2.Value = 0;
                label3.Text = progressBar2.Value.ToString();
                MessageBox.Show("Has ganado!!!");
            }


        }

        private void button3_Click(object sender, EventArgs e)
        {
            if (progressBar2.Value > 90)
            {
                progressBar2.Value = progressBar2.Value - 90;
                label3.Text = progressBar2.Value.ToString();
            }
            else
            {
                progressBar2.Value = 0;
                label3.Text = progressBar2.Value.ToString();
                MessageBox.Show("Has ganado!!!");
            }
        }

        private void button4_Click(object sender, EventArgs e)
        {
            if (progressBar2.Value > 70)
            {
                progressBar2.Value = progressBar2.Value - 70;
                label3.Text = progressBar2.Value.ToString();
            }
            else
            {
                progressBar2.Value = 0;
                label3.Text = progressBar2.Value.ToString();
                MessageBox.Show("Has ganado!!!");
            }
        }

    }
}